import Hammer from 'hammerjs'
import { App } from 'vue'

function initHammer(app: App) {
  app.directive('swipe', {
    beforeMount(el, binding) {
      const hammerTest = new Hammer(el)
      hammerTest.on('swipe', binding.value)
    },
  })
}

export default function (app: App) {
  initHammer(app)
}
